<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>红酒销售管理系统 - 功能框图</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #722f37, #8b4513);
            color: white;
            text-align: center;
            padding: 30px;
            margin-bottom: 0;
        }

        .header h1 {
            margin: 0;
            font-size: 2.5em;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .header p {
            margin: 10px 0 0 0;
            font-size: 1.2em;
            opacity: 0.9;
        }

        .diagram-container {
            padding: 40px;
            background: #f8f9fa;
        }

        .system-overview {
            text-align: center;
            margin-bottom: 40px;
        }

        .main-system {
            background: linear-gradient(135deg, #722f37, #8b4513);
            color: white;
            padding: 20px;
            border-radius: 15px;
            font-size: 1.3em;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(114, 47, 55, 0.3);
            display: inline-block;
            min-width: 300px;
        }

        .flow-container {
            display: flex;
            flex-direction: column;
            gap: 30px;
            margin-top: 40px;
        }

        .flow-level {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            gap: 30px;
            flex-wrap: wrap;
        }

        .module {
            background: white;
            border: 3px solid #722f37;
            border-radius: 12px;
            padding: 20px;
            min-width: 250px;
            max-width: 350px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            position: relative;
        }

        .module:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        }

        .module-title {
            background: #722f37;
            color: white;
            padding: 10px 15px;
            margin: -20px -20px 15px -20px;
            border-radius: 8px 8px 0 0;
            font-weight: bold;
            font-size: 1.1em;
        }

        .module-content {
            line-height: 1.6;
        }

        .module-content ul {
            margin: 10px 0;
            padding-left: 20px;
        }

        .module-content li {
            margin: 8px 0;
            color: #555;
        }

        .module-content .feature {
            color: #722f37;
            font-weight: 600;
        }

        .auth-modules {
            background: #e8f4f8;
            border-color: #5bc0de;
        }

        .auth-modules .module-title {
            background: #5bc0de;
        }

        .user-modules {
            background: #f0f8e8;
            border-color: #5cb85c;
        }

        .user-modules .module-title {
            background: #5cb85c;
        }

        .admin-modules {
            background: #fff3e0;
            border-color: #f0ad4e;
        }

        .admin-modules .module-title {
            background: #f0ad4e;
        }

        .util-modules {
            background: #f5f0ff;
            border-color: #9b59b6;
        }

        .util-modules .module-title {
            background: #9b59b6;
        }

        .connection-line {
            width: 2px;
            height: 30px;
            background: #722f37;
            margin: 0 auto;
        }

        .connection-horizontal {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 20px 0;
        }

        .connection-horizontal::before {
            content: '';
            flex: 1;
            height: 2px;
            background: #722f37;
            margin: 0 20px;
        }

        .connection-horizontal::after {
            content: '';
            flex: 1;
            height: 2px;
            background: #722f37;
            margin: 0 20px;
        }

        .arrow-down {
            width: 0;
            height: 0;
            border-left: 15px solid transparent;
            border-right: 15px solid transparent;
            border-top: 20px solid #722f37;
            margin: 10px auto;
        }

        .business-flow {
            background: white;
            border-radius: 12px;
            padding: 30px;
            margin-top: 40px;
            border: 2px solid #ddd;
        }

        .business-flow h3 {
            color: #722f37;
            text-align: center;
            margin-bottom: 30px;
            font-size: 1.5em;
        }

        .flow-steps {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        .flow-step {
            background: linear-gradient(135deg, #722f37, #8b4513);
            color: white;
            padding: 15px 20px;
            border-radius: 25px;
            font-weight: bold;
            position: relative;
            min-width: 120px;
            text-align: center;
            flex: 1;
            margin: 0 10px;
        }

        .flow-step:not(:last-child)::after {
            content: '→';
            position: absolute;
            right: -25px;
            top: 50%;
            transform: translateY(-50%);
            color: #722f37;
            font-size: 1.5em;
            font-weight: bold;
        }

        .tech-features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 40px;
        }

        .tech-card {
            background: white;
            border-radius: 10px;
            padding: 20px;
            border-left: 5px solid #722f37;
            box-shadow: 0 3px 10px rgba(0,0,0,0.1);
        }

        .tech-card h4 {
            color: #722f37;
            margin-top: 0;
            margin-bottom: 15px;
        }

        .footer {
            background: #2c3e50;
            color: white;
            text-align: center;
            padding: 20px;
            margin-top: 40px;
        }

        @media (max-width: 768px) {
            .flow-level {
                flex-direction: column;
                align-items: center;
            }

            .module {
                max-width: 100%;
            }

            .flow-steps {
                flex-direction: column;
            }

            .flow-step:not(:last-child)::after {
                content: '↓';
                right: 50%;
                top: 100%;
                transform: translateX(50%);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🍷 红酒销售管理系统</h1>
            <p>系统功能结构图 & 业务流程图</p>
        </div>

        <div class="diagram-container">
            <!-- 系统总览 -->
            <div class="system-overview">
                <div class="main-system">
                    红酒销售管理系统<br>
                    <small>Wine Sales Management System</small>
                </div>
            </div>

            <div class="arrow-down"></div>

            <!-- 系统入口层 -->
            <div class="flow-level">
                <div class="module">
                    <div class="module-title">🚪 系统入口 (MainUI)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">欢迎界面显示</li>
                            <li class="feature">登录/注册选择</li>
                            <li class="feature">权限识别跳转</li>
                            <li class="feature">系统退出控制</li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="arrow-down"></div>

            <!-- 认证层 -->
            <div class="flow-level">
                <div class="module auth-modules">
                    <div class="module-title">🔐 用户登录 (LoginUI)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">用户名密码验证</li>
                            <li class="feature">权限级别识别</li>
                            <li class="feature">用户信息获取</li>
                            <li class="feature">输入数据校验</li>
                        </ul>
                    </div>
                </div>

                <div class="module auth-modules">
                    <div class="module-title">📝 用户注册 (RegisterUI)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">用户名唯一性检查</li>
                            <li class="feature">密码安全设置</li>
                            <li class="feature">默认权限分配</li>
                            <li class="feature">账户初始化</li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="arrow-down"></div>

            <!-- 功能层 -->
            <div class="flow-level">
                <!-- 普通用户功能 -->
                <div class="module user-modules">
                    <div class="module-title">👤 普通用户功能 (UserUI)</div>
                    <div class="module-content">
                        <h4>📋 个人信息管理</h4>
                        <ul>
                            <li>修改个人资料</li>
                            <li>账户余额充值</li>
                        </ul>

                        <h4>🔍 商品浏览</h4>
                        <ul>
                            <li>红酒信息查询</li>
                            <li>多条件筛选</li>
                        </ul>

                        <h4>🛒 购物功能</h4>
                        <ul>
                            <li>红酒购买下单</li>
                            <li>库存余额检查</li>
                            <li>订单码生成</li>
                        </ul>

                        <h4>📦 订单管理</h4>
                        <ul>
                            <li>个人订单查询</li>
                            <li>订单状态跟踪</li>
                        </ul>
                    </div>
                </div>

                <!-- 管理员功能 -->
                <div class="module admin-modules">
                    <div class="module-title">⚙️ 管理员功能 (AdminUI)</div>
                    <div class="module-content">
                        <h4>👥 用户管理</h4>
                        <ul>
                            <li>用户CRUD操作</li>
                            <li>用户信息查询</li>
                        </ul>

                        <h4>📋 订单管理</h4>
                        <ul>
                            <li>订单CRUD操作</li>
                            <li>订单状态处理</li>
                            <li>库存同步更新</li>
                        </ul>

                        <h4>🍷 商品管理</h4>
                        <ul>
                            <li>红酒CRUD操作</li>
                            <li>库存管理</li>
                            <li>价格管理</li>
                        </ul>

                        <h4>📊 订单处理</h4>
                        <ul>
                            <li>订单状态流转</li>
                            <li>发货地址管理</li>
                            <li>按码快速处理</li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="arrow-down"></div>

            <!-- 工具层 -->
            <div class="flow-level">
                <div class="module util-modules">
                    <div class="module-title">🛠️ 数据校验 (InputValidator)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">字符串非空校验</li>
                            <li class="feature">数值范围校验</li>
                            <li class="feature">枚举值校验</li>
                            <li class="feature">可选输入处理</li>
                        </ul>
                    </div>
                </div>

                <div class="module util-modules">
                    <div class="module-title">📐 字符串处理 (StringUtil)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">显示宽度计算</li>
                            <li class="feature">文本截断填充</li>
                            <li class="feature">表格对齐处理</li>
                            <li class="feature">中英文混合支持</li>
                        </ul>
                    </div>
                </div>

                <div class="module util-modules">
                    <div class="module-title">🎲 订单码生成 (OrderCodeUtil)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">8位唯一码生成</li>
                            <li class="feature">重复性检查</li>
                            <li class="feature">随机算法保证</li>
                        </ul>
                    </div>
                </div>

                <div class="module util-modules">
                    <div class="module-title">🗄️ 数据库初始化 (DbInit)</div>
                    <div class="module-content">
                        <ul>
                            <li class="feature">表结构创建</li>
                            <li class="feature">约束条件设置</li>
                            <li class="feature">默认数据插入</li>
                        </ul>
                    </div>
                </div>
            </div>

            <!-- 业务流程图 -->
            <div class="business-flow">
                <h3>🔄 核心业务流程</h3>

                <h4 style="color: #5cb85c; margin-top: 30px;">👤 用户购买流程</h4>
                <div class="flow-steps">
                    <div class="flow-step">用户登录</div>
                    <div class="flow-step">浏览商品</div>
                    <div class="flow-step">选择下单</div>
                    <div class="flow-step">库存检查</div>
                    <div class="flow-step">余额验证</div>
                    <div class="flow-step">生成订单</div>
                    <div class="flow-step">扣减库存</div>
                </div>

                <h4 style="color: #f0ad4e; margin-top: 30px;">⚙️ 管理员订单处理流程</h4>
                <div class="flow-steps">
                    <div class="flow-step">查询订单</div>
                    <div class="flow-step">筛选订单</div>
                    <div class="flow-step">确认付款</div>
                    <div class="flow-step">安排发货</div>
                    <div class="flow-step">确认收货</div>
                    <div class="flow-step">订单完成</div>
                </div>

                <h4 style="color: #5bc0de; margin-top: 30px;">📦 库存管理流程</h4>
                <div class="flow-steps">
                    <div class="flow-step">商品入库</div>
                    <div class="flow-step">订单扣减</div>
                    <div class="flow-step">库存监控</div>
                    <div class="flow-step">订单取消</div>
                    <div class="flow-step">库存恢复</div>
                </div>
            </div>

            <!-- 技术特色 -->
            <div class="tech-features">
                <div class="tech-card">
                    <h4>🏗️ 分层架构设计</h4>
                    <p>采用经典的MVC分层架构，UI层、Service层、DAO层、Model层职责明确，便于维护和扩展。</p>
                </div>

                <div class="tech-card">
                    <h4>🏭 工厂模式应用</h4>
                    <p>使用工厂模式创建Service和DAO对象，降低耦合度，提高代码可维护性。</p>
                </div>

                <div class="tech-card">
                    <h4>🔒 数据完整性保障</h4>
                    <p>通过外键约束、检查约束、级联操作等保证数据完整性和一致性。</p>
                </div>

                <div class="tech-card">
                    <h4>✨ 用户体验优化</h4>
                    <p>输入校验、错误提示、表格格式化、中英文对齐等提升用户操作体验。</p>
                </div>
            </div>
        </div>

        <div class="footer">
            <p>🍷 红酒销售管理系统 | 系统功能结构图</p>
            <p>生成时间：2024年12月 | 开发团队：红酒销售管理系统开发团队</p>
        </div>
    </div>
</body>
</html>
